using UnityEngine;
using System.Collections;

public class BallScript : MonoBehaviour {
	
	public bool IsBad = false;
	
	// Use this for initialization
	void Start () {
	}
	
	// Update is called once per frame
	
	void OnCollisionExit(Collision collisionInfo)
	{
		// angle jitter
		Vector3 dir = rigidbody.velocity.normalized;
		dir = dir + Random.insideUnitSphere * 0.5f;
		dir.Normalize();
		rigidbody.velocity =
			new Vector3(TestScript.BallMaxSpeed * dir.x, 0,
						TestScript.BallMaxSpeed * dir.z);
	}
}
